﻿<%@page import="weaver.general.Util"%>
<%@page import="java.util.*" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %> 
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%
	int requestid = Util.getIntValue(request.getParameter("requestid"),0);//请求id
	int workflowid = Util.getIntValue(request.getParameter("workflowid"));//流程id
	int formid = Util.getIntValue(request.getParameter("formid"));//表单id
	int isbill = Util.getIntValue(request.getParameter("isbill"));//表单类型，1单据，0表单
	int nodeid = Util.getIntValue(request.getParameter("nodeid"));//流程的节点id
	int scoreid = Util.getIntValue(request.getParameter("scoreid"));//scoreid
%>
<%
	response.setContentType("text/xml;charset=UTF-8"); 
	StringBuffer buffer = new StringBuffer();
	String array = request.getParameter("array");
	//System.out.println("==========================array:"+array+"===============================");
	//不传值会报错，处理
	if(null == array ||"".equals(array)){ return;}
	array = Util.null2String(array);
	String[] arr = array.split(",");
	if(arr.length==0){return;}
	String sql = "";
	for(int i=0; i<arr.length; i++){
		String[] arrs = arr[i].split("@");
		if(arrs.length==0){return;}
		sql = "SELECT * FROM uf_kcbd WHERE id="+arrs[0];
		rs.execute(sql);
		if(rs.next());
		double sl = Util.getDoubleValue(rs.getString("sl"));
		String pxbm = Util.null2String(rs.getString("pxbm"));
		if(Double.parseDouble(arrs[1]) - sl > 0){
			buffer.append("【品相编码】："+pxbm+"在库数量不足!          ");
		}
	}
	String result = "";
	result = buffer.toString();
	
	PrintWriter pw = response.getWriter();
	pw.write(result);
	pw.flush();
	pw.close();

%>


